package com.egoo.ticket.server.dao;

import com.egoo.ticket.server.pojo.dto.TaskFormDto;
import com.egoo.ticket.server.pojo.entity.TaskForm;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;


/**
 * 任务表单
 * @author Administrator
 */
@Component
public interface TaskFormDao {
	/**
	 * 创建
	 * @param taskForm
	 * @return
	 */
	Integer create(TaskForm taskForm);
	/**
	 * 根据id查询删除任务
	 * @param taskId
	 * @return
	 */
	Integer deleteByTaskId(String taskId);

	/**
	 * 根据id查询
	 * @param taskId
	 * @return
	 */
	TaskForm getByTaskId(String taskId);

	/**
	 * 通过condition查询
	 * @param taskFormDto
	 * @return
	 */
	List<TaskForm> getByCondition(TaskFormDto taskFormDto);

	/**
	 * /更新表单
	 * @param taskForm
	 * @return
	 */
	Integer update(TaskForm taskForm);

	/**
	 * 通过流程实例id查询
	 * @param processInstanceId
	 * @return
	 */
	List<TaskForm> selectByProcessInstanceId(String processInstanceId);

	/**
	 * 查询最新的任务
	 * @param taskFormDto
	 * @return
	 */
	TaskForm selectLastTaskformInfo(TaskFormDto taskFormDto);

	/**
	 * 通过节点id查询
	 * @param currentWorkOrderNodeId
	 * @return
	 */
    TaskForm selectByNodeId(Long currentWorkOrderNodeId);

	/**
	 * 通过流程实例id和节点id查询
	 * @param taskForm
	 * @return
	 */
	Integer updateByProcessInstanceIdAndNodeId(TaskForm taskForm);

	/**
	 * 通过map结果集查询
	 * @param searchMap
	 * @return
	 */
	TaskForm selectFiledContentByCondition(Map<String, Object> searchMap);

	TaskForm selectDynamic(Map<String,Object> map);
}
